1. Field of the Invention
The present invention relates generally to maintaining and improving file system integrity. More specifically, the present invention relates to a method, apparatus, and computer usable code to obtain file system metadata in a dense format so that such data may be transmitted off-site for expert review and remedies.
2. Description of the Related Art
In computing, a file system is a structure for storing and organizing computer files and the data they contain to make it easy to find and access the files. File systems may use a storage device such as a hard disk or CD-ROM and involve maintaining the physical location of the files. Alternatively, a file system may be a virtual file system. A virtual file system exists only as an access method for virtual data or for data over a network.
File systems are made of two types of data. The first type of data, which usually predominates, is user data. The content type of user data may be, for example, text, graphics, music, and computer instructions. The second type of data is file system metadata. File system metadata is all the data that is not the user data. Metadata informs a processing system of the statistics and structure of the files containing user data.
File system metadata includes a superblock, which provides a file system summary and includes pointers to other information. An inode is file system metadata that is associated with each file. The inode denotes the length of the file in bytes, an associated device identifier, a user identifier, a group identifier, an inode number that may be unique, the file mode, a timestamp, and a reference count.
A block is the smallest unit of disk storage that may be allocated to a file. For example, a processor may establish a block to be 1024 bytes on a particular file system. This means that a file will nearly always fill one or more blocks, with the final block being only part occupied by data.
Parts of a file may reside in numerous blocks, sometimes scattered about a disk drive. An inode may have several blocks listed within the inode. For larger files, an inode may include an indirect block, which may point to a list of additional blocks. Often this leads to a tree-like structure of multiple levels of indirect blocks pointing to successively deeper tiers of blocks.
File systems tend to be very large data structures. When a processor makes changes to the file system, the processor often requires many separate write operations. Occasionally an error or other fault interrupts the sequence of writes, for example, a power failure may occur.
A race condition may happen when a processor encounters an error in this situation. A race condition is what happens when two events in an electronic device essentially race each other to see which influences the device's state or output, wherein the first event or signal to arrive controls the device's state. In the context of file systems, such as a journaling file system, two steps occur when updating the file system: 1) removing a file's directory entry; and 2) marking the file's inode as free space in a free space map.
If power fails and the removing step happens immediately prior to the crash, an orphaned inode will be present, and more of the blocks will appear to be allocated to storage than is actually allocated. If step marking step happens immediately prior to the crash, the not-yet-deleted inode will be marked free and possibly be overwritten by something else.
All journaling file systems have a journal log. The journal log is a place where an operating system writes file metadata in preparation to making a file change to the file system. The purpose is to have a copy of the intended change recorded somewhere, so that recovery of the file system may be performed in the event a power or other failure prevents the file change to actually get written to the file system.
A hazard involved with remotely outsourcing maintenance and recovery of file systems is that transmitted details of the file system may be intercepted. This is especially true when a user transmits data transmitted via the internet. Even encrypted data, once intercepted, may be subject to compromise. Therefore, it would be advantageous to have a method, apparatus, and computer usable program product that avoids transmitting sensitive information over an unsecure network.